//
//  UIButton+Category.m
//  reSearchDemo
//
//  Created by 云库 on 15/9/22.
//  Copyright (c) 2015年 Kiwaro. All rights reserved.
//

#import "UIButton+Category.h"

@implementation UIButton (Category)

+ (UIButton *)buttonWithTarget:(id)target action:(SEL)action image:(NSString *)image ;
{
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
    // 设置图片
    [btn setBackgroundImage:[UIImage imageNamed:image] forState:UIControlStateNormal];
    
    // 设置尺寸
    btn.size = btn.currentBackgroundImage.size;
    return btn;
}


@end
